home *** CD-ROM | disk | other *** search
/ SGI Hot Mix 8 / Hot Mix 8.iso / .all / bin / INSTALL_REMOVE.csh (.txt) < prev    next >
Linux/UNIX/POSIX Shell Script  |  1994-06-22  |  3KB  |  124 lines

  1. #!/bin/csh 
  2. #
  3. ###############################################################################
  4. #
  5. #              Copyright (c) 1994 Silicon Graphics
  6. #                     All Rights Reserved
  7. #
  8. #    Version:    1.0
  9. #
  10. #       Date:    Fri Apr 22 20:01:50 PDT 1994
  11. #
  12. #     Author:    Joe Ushana and Craig McFarland
  13. #
  14. #    Purpose:    To install and remove software from Hot Mix CD
  15. #
  16. #            Check for writeability to drive
  17. #            Check for enough disk space on target drive
  18. #            Check for existence of Software on target drive
  19. #                by checking for existence of 
  20. #                /usr/tmp/PRODUCTNAME_temp file,
  21. #                "versions -s $PRODUCTNAME*", etc.
  22. #            Check for 
  23. #            Check for 
  24. #            Check for 
  25. #            Incrementally write to a temp file the status of install
  26. #                remove so that it can be completed if interrupted
  27. #
  28. ################################################################################
  29. #
  30. #
  31. limit coredumpsize 0
  32. alias cd cd
  33.  
  34. if ($#argv < 1) then
  35.     echo
  36.     echo "C-shell script used to install and remove "
  37.     echo "software from the Silicon Graphics Hot Mix CD HotMix8"
  38.     echo
  39.     echo 'example: ./INSTALL_REMOVE.csh YourSoftwareName` '
  40.     echo
  41. endif
  42.  
  43. setenv PRODUCTNAME $argv[1]
  44. setenv INST_DIR /usr/tmp/$PRODUCTNAME
  45. setenv KBYTES_REQ $argv[2]
  46.  
  47. setenv PRODUCTDIR $HOTMIXDIR/products/$PRODUCTNAME
  48. cd $PRODUCTDIR
  49.  
  50. setenv USERID  `id | cut -d'(' -f2 | cut -d')' -f1`
  51. setenv GROUPID `id | cut -d'(' -f3 | cut -d')' -f1`
  52.  
  53. echo "****************************"
  54. echo "PRODUCTNAME=$PRODUCTNAME"
  55. echo "PRODUCTDIR=$PRODUCTDIR"
  56. echo "   INST_DIR=$INST_DIR"
  57. echo " KBYTES_REQ=$KBYTES_REQ"
  58. echo "     USERID=$USERID"
  59. echo "    GROUPID=$GROUPID"
  60. echo "****************************"
  61. echo
  62. #
  63. #
  64. ################################################################################
  65. #
  66. #
  67. #
  68. ASK:
  69. echo
  70. echo "Please select one of the following:"
  71. echo
  72. echo "   1) Install $PRODUCTNAME"
  73. echo "   2) Remove $PRODUCTNAME"
  74. echo
  75. echo "   Q) Quit"
  76. echo
  77. echo -n "Enter choice: "
  78. set A = $<
  79. switch ($A)
  80.         case 1:
  81.                 goto INSTALLIT
  82.                 breaksw
  83.         case 2:
  84.                 goto REMOVEIT
  85.                 breaksw
  86.         case [Qq]:
  87.                 echo
  88.                 echo "*** Quit ***"
  89.                 echo
  90.                 exit 0
  91.         default:
  92.                 echo
  93.                 echo "You must choose 1, 2, or Q.  Try again."
  94.                 goto ASK
  95. endsw
  96.  
  97. #**********
  98. INSTALLIT:
  99. #**********
  100. #
  101. echo
  102. echo "Running InstallIt"
  103. echo
  104. #
  105.     cd $HOTMIXDIR/products/$PRODUCTNAME
  106. #    cd $PRODUCTDIR
  107.  
  108.          ./InstallIt
  109.  
  110. goto ASK
  111.  
  112. #**********
  113. REMOVEIT:
  114. #**********
  115. #
  116. echo
  117. echo "Running Removet2"
  118. echo
  119. #
  120. #    cd $HOTMIXDIR/products/$PRODUCTNAME
  121.         ./RemoveIt
  122.  
  123. goto ASK
  124.